<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../../../common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<sfa:mainTitle></sfa:mainTitle>
		<%@ include file="../../../common/meta.jsp"%>
		<script type="text/javascript"
			src="${path}/script/lhgdialog/lhgdialog.min.js">
</script>
<script type="text/javascript" src="${path}/ckeditor/ckeditor.js"></script>
		<script type="text/javascript" src="${path}/ckfinder/ckfinder.js"></script>
		<script type="text/javascript" src="/ckeditor/ckeditor.js?t=B37D54V"></script>
		<script type="text/javascript">
function openCut(url) {
	$.dialog( {
		title : '头像修改',
		lock : true,
		background : '#FFF',
		opacity : 0.1,
		max : true,
		min : true,
		width : '700px',
		height : '450px',
		content : 'url:' + url,
		close : function() {
			location.reload();
		}
	});
}

function deletePic(id) {

	var url = "${path}/manage/agenter/index/delete?agentId=" + id;
	art.dialog( {
		lock : true,
		content : '确定要删除吗？',
		ok : function() {
			art.dialog( {
				id : "loading",
				lock : true,
				drag : false,
				resize : false,
				title : "正在进行...",
				time : 5
			});
			$.post(url, null, function(result) {
				art.dialog( {
					id : 'loading'
				}).close();//关闭等待框
					if (result.flag) {
						art.dialog( {
							icon : "succeed",
							content : "删除成功!",
							lock : true,
							ok : function() {
								$("#photo").attr("src",
										"${path}" + result.photo);

								location.reload();
							}
						});
					} else {
						art.dialog( {
							icon : "error",
							content : "删除失败!",
							lock : true,
							ok : true
						});
					}

				});

			return true;
		},
		cancelVal : '取消',
		cancel : true
	});
}
</script>
	</head>



	<body id="master">

		<sfa:mainHeader></sfa:mainHeader>

		<!--右边-->
		<div class="webpart3 contentarea">
			<div class="webpart-head">
				<div class="webpart-head-item">
					个人信息

				</div>
			</div>
			<div class="webpart-main">
				<div class="webpart-main-item" style="padding-top: 12px; text-align: left;">
						
							<table width="100%" border="0" cellspacing="0" cellpadding="10">
									<tr>
										<td><img alt="" src="${path }${photo}" id="photo"></td>
									</tr>
									
							</table>
							<input type="button" id="showPage" value="设置头像" class="linkbtn2"
								onclick='openCut("${path}/manage/agenter/index/updateImage?agentId=${agentId}")'>
							<c:if test="${requestScope.photo!=requestScope.defaultPic}">	
							<input type="button" id="delete" onclick='deletePic("${agentId}")' value="删除头像" class="linkbtn2"  />
							</c:if>
							<br />
							<form action="${path}/manage/agenter/index/submitagentinfo" method="post">
								<table width="100%" border="1" cellspacing="0" cellpadding="10">
								 
								 <tr>
								 	<td>
								 		是否显示:<select type="text" name="validFlag" class="input-txt">
								 					 <option value="1">是</option> 
								 					 <option value="0">否</option>
								 				</select>
								 		有效日期（天）:<input type="text" name="honourVaildDate" class="input-txt" value="30" />
									</td>
								 </tr>
								 
								 <tr>
								 	<th>个人简介:</th>
								 </tr>
								 <tr>
								 	<td>
								 		<textarea name="agentInfo" rows=5 cols=120 style="overflow:auto"></textarea>
									</td>
								 </tr>
								 <tr>
								 	<th>获奖感言:</th>
								 </tr>
								 <tr>  
                                    <td   colspan="2" align="left">
										<textarea rows="6" cols="40" name="honourFeeling"
											id="honourFeeling"></textarea>

										<font color="red" class="honourFeeling">${honourFeeling}</font>
									</td>
                                </tr>
								</table>
								 <ckfinder:setupCKEditor editor="honourFeeling"
							basePath="/sfa/ckfinder/" />
						<ckeditor:replace replace="honourFeeling" basePath="/ckeditor/"></ckeditor:replace>
						<input type="hidden" name="type" value="new">
						<input type="hidden" name="agentLogId" value="${agentLogId}">
						<input type="hidden" name="agentId" value="${agentId}">
						<input type="hidden" name="changeDate" value="${changeDate}">
						<input type="hidden" name="affixMainId" value="${affixMainId}">
						<div><input type="submit"  value="保存" /></div>
							</form>
							
				</div>
			</div>
			<div class="webpart-foot">
				<div class="webpart-foot-item">
				</div>
			</div>
		</div>
		<sfa:mainFooter></sfa:mainFooter>
	</body>
</html>


